package com.yjtc.cbg.commonutildemo.View;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;

import com.yjtc.cbg.commonutildemo.observable.SmsObserver;

import java.lang.ref.WeakReference;

/**
 * Created by chenboge on 2017/3/1.
 */
public class SmsActivity extends BaseActivity implements SmsObserver.SmsListener{

    private SmsObserver mSmsObserver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mSmsObserver = new SmsObserver(new Handler(), new WeakReference<Activity>(this), this);
        this.getContentResolver().registerContentObserver(Uri.parse("content://sms/"), true,mSmsObserver);
    }

    @Override
    public int getContentVIew() {
        return 0;
    }

    @Override
    public void onResult(String smsContent) {
        //处理获取到的验证码
    }
}
